﻿package cn.whdream.status;

import java.util.Iterator;

public class JoinDemo extends Thread {
	
	public static void main(String[] args) throws InterruptedException {
		JoinDemo o = new JoinDemo();
		o.start();
		for(int i = 0;i<1000;i++) {
			if(i == 100) {
				o.join();//阻塞main方法
			}
			System.out.println("main。。。。"+i);
		}
	}

	@Override
	public void run() {
		super.run();
		for(int y =0;y<1000;y++) {
			System.out.println("thread。。。。"+y);
		}
		
	}
	
	
}
